﻿using System;
using Castle.Windsor;

namespace OS.Infrastructure.Common
{
    /// <summary>
    /// Contains links for service contract and realization.
    /// </summary>
    public static class IoC
    {
        // TODO: добавить свою реализацию

        private static WindsorContainer windsorContainer;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="container"></param>
        public static void Init(WindsorContainer container)
        {
            windsorContainer = container;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <returns></returns>
        public static TService Resolve<TService>()
        {
            return windsorContainer.Resolve<TService>();
        }
    }
}